import { findHeadCategory } from '@/api/home'
// 导航分类模块
// 购物车状态
export default {
  namespaced: true,
  state: () => ({
    list: []
  }),
  mutations: {
    // 设置list的值
    setCategory (state, headCategory) {
      state.list = headCategory
    }
  },
  actions: {
    async asyncSetList (ctx) {
      const res = await findHeadCategory()
      console.log(res)
      ctx.commit('setCategory', res.result)
    }
  }
}
